package com.xuzhijie.pms.entity.vo;

import com.xuzhijie.pms.entity.Repair;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class RepairVo {
    private String id;

    /**
     * 维修地点
     */
    private String repairLocation;

    /**
     * 维修类型，1水路，2电路，3门窗，4公共设施
     */
    private String Type;

    /**
     * 维修进度
     */
    private String Progress;

    /**
     * 工单来源，1业主上报，2公司指派
     */
    private Integer source;

    private LocalDateTime createTime;

    private String images;

    private String phone;

    private String description;

    public RepairVo(Repair repair){
        if (repair.getRepairType() == 1){
            this.Type = "水路";
        }
        if (repair.getRepairType() == 2){
            this.Type = "电路";
        }
        if (repair.getRepairType() == 3){
            this.Type = "门窗";
        }if (repair.getRepairType() == 4){
            this.Type = "公共设施";
        }

        if (repair.getRepairProgress() == 1){
            this.Progress = "待分配工单";
        }
        if (repair.getRepairProgress() == 2){
            this.Progress = "待工程确认";
        }
        if (repair.getRepairProgress() == 3){
            this.Progress = "待维修";
        }
        if (repair.getRepairProgress() == 4){
            this.Progress = "已完成";
        }

    }
}
